In [ ]:
import os
import glob
from datetime import datetime

import astropy.time as atime
from astropy.table import Table
import matplotlib.pyplot as pl
%matplotlib inline
import numpy as np

In [ ]:
d = Table(np.genfromtxt("/Users/adrian/projects/triand-rrlyrae/data/targets/gass.txt", names=True, dtype=None))
# d = Table(np.genfromtxt("/Users/adrian/projects/triand-rrlyrae/data/targets/triand1_targets_2015.txt", names=True, dtype=None))
print(d.colnames)

In [ ]:
phot = Table(np.genfromtxt("/Users/adrian/Downloads/CSS_RR_phot/RRinput1.phot", 
                           names=["ID", "MJD", "mag", "mag_err", "ra", "dec"], dtype=None, delimiter=","))
print(phot.colnames)

In [ ]:
for _id in d['CSSIDnum'][3:]:
    row = d[(d['CSSIDnum'] == _id)]
    
    for filename in glob.glob("/Users/adrian/Downloads/CSS_RR_phot/*.phot"):
        just_ID = np.genfromtxt(filename, dtype=None, delimiter=",", usecols=[0])
        if _id in just_ID:
            print(filename)
        else:
            continue
            
        phot = np.genfromtxt(filename, names=["ID", "MJD", "mag", "mag_err", "ra", "dec"], dtype=None, delimiter=",")
        this_phot = phot[phot['ID'] == _id]
    
    pl.errorbar(((this_phot['MJD']-row['mjd0']) / row['period']) % 1, 
                this_phot['mag'], this_phot['mag_err'], 
                marker='o', ecolor='#666666', ls='none')
    pl.ylim(pl.ylim()[::-1])
    print(row['amp'])
    break

GASS2015RR7,15,20 have bad S/N...let's look at their light curves


In [ ]:
def plot_light_curve(apw_name, now=False):
    row = d[(d['ID2015'] == apw_name)]
    _id = row['CSSIDnum']
    
    for filename in glob.glob("/Users/adrian/Downloads/CSS_RR_phot/*.phot"):
        just_ID = np.genfromtxt(filename, dtype=None, delimiter=",", usecols=[0])
        if _id in just_ID:
            print(filename)
        else:
            continue
            
        phot = np.genfromtxt(filename, names=["ID", "MJD", "mag", "mag_err", "ra", "dec"], dtype=None, delimiter=",")
        this_phot = phot[phot['ID'] == _id]
    
    pl.errorbar(((this_phot['MJD']-row['mjd0']) / row['period']) % 1, 
                this_phot['mag'], this_phot['mag_err'], 
                marker='o', ecolor='#666666', ls='none')
    if now:
        time = atime.Time(datetime.utcnow(), scale='utc')
        pl.axvline(((time.mjd-row['mjd0']) / row['period']) % 1)
        
    pl.ylim(pl.ylim()[::-1])

In [ ]:
plot_light_curve('GASS2015RR42')#, now=True)

In [ ]: